package com.shxc.smarttrade.kvb.adapter;

import android.os.Handler;
import android.os.Message;
import android.support.annotation.LayoutRes;
import android.view.View;
import android.widget.ListView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shxc.smarttrade.R;
import com.shxc.smarttrade.kvb.model.QuestionsModel;

import org.xchris.x;


/**
 * 调查提问
 */
public class QuestionsAdapter extends BaseQuickAdapter<QuestionsModel.DataBean, BaseViewHolder> {
    Handler handler;

    public QuestionsAdapter(@LayoutRes int layoutResId, Handler h) {
        super(layoutResId);
        handler = h;
    }

    @Override
    protected void convert(BaseViewHolder helper, final QuestionsModel.DataBean model) {
        helper.setText(R.id.textview, model.getName());
        ListView listview = helper.getView(R.id.listview);
        AnswersAdapter adapter = new AnswersAdapter(x.app(),model.getAnswersList(),handler);
        listview.setAdapter(adapter);
    }
}
